﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using TextExtractionMaster;

namespace TextExtractionMaster.Extractor
{
    public class WordDocxTextExtractor : ITextExtractor
    {
        public string ExtractText(string filePath)
        {
            using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(filePath, false))
            {
                return wordDoc.MainDocumentPart.Document.Body.InnerText;
            }
        }
    }
}